<?php require_once(BASEPATH.'application/controllers/validaciones.php');
//Cliente
class cajeros extends validaciones {
	
	var $titulo;

	function cajeros(){
		parent::Controller(); 
		$this->load->library("rapyd");
		$this->load->library('pi18n');
		$this->titulo=$this->datasis->traevalor('TITULO4');
	}

	function index(){
		redirect("ventas/cajeros/filteredgrid");
	}
	function filteredgrid(){
        
        $this->rapyd->load("datagrid2");
		
		$grid = new DataGrid2("Resultado","cajero");
		$grid->order_by("cajero","ASC");
        //$grid->agrupar(" ",'nombre');
		$grid->per_page=10;  
		
        $uri = anchor('ventas/cajeros/dataedit/show/<#cajero#>','<#cajero#>');	
        
        $grid->column("Cajero"               ,$uri       ,"align='center'");
        $grid->column("Nombre"              ,"nombre"     ,"align='left'");
        $grid->column("Cargo en la Empresa" ,"cargo"       ,"align='left'");
    
       
		$grid->add("ventas/cajeros/dataedit/create");
        
		$grid->build('datagridST');
		//echo $grid->db->last_query();
		
		$cana=$grid->recordCount;
		$grid=$grid->output;
		
		$style ='
		<style type="text/css">
		.fakeContainer { /* The parent container */
		    margin: 5px;
		    padding: 0px;
		    border: none;
		    width: 1000px; /* Required to set */
		    height: 320px; /* Required to set */
		    overflow: hidden; /* Required to set */
		}
		</style>	
		';

		$data['style']   = $style;
		$data['style']  .= style('superTables.css');

		$data['content'] = $grid;
	
		$data['content'].= $this->pi18n->fallas();
		$data['filtro']  = ' ';

		$data['title']   = heading("Cajeros");
		$data['script']  = script('jquery.js');
		$data["script"] .= script('superTables.js');
		$data['head']    = $this->rapyd->get_head();

		$this->load->view('view_ventanas', $data);
	}
     function dataedit(){
		
		$this->rapyd->load("dataedit");	
        			
		$edit = new DataEdit("Informaci&oacute;n del Cajero", "cajero");
		$edit->back_url = site_url("ventas/cajeros/filteredgrid");
				
		$edit->cajero = new inputField('Cajero','cajero');
		$edit->cajero->size = 10;
		$edit->cajero->maxlength=10;
		
        $edit->nombre = new inputField('Nombre', 'nombre');
		$edit->nombre->size = 80;
		$edit->nombre->rule = 'required|strtoupper';
		$edit->nombre->maxlength=150;
        
        $edit->cargo = new inputField('Cargo en la Empresa', 'cargo');
		$edit->cargo->size = 50;
		$edit->cargo->maxlength=50;
        
		$edit->buttons("back","save","modify","undo");
		$edit->build();
               
		$data['content'] =$edit->output;
		$data['title']   =  heading("Cajas y cajeros");
		$data["head"]    = script("jquery.pack.js").script("plugins/jquery.numeric.pack.js").script("plugins/jquery.floatnumber.js").$this->rapyd->get_head();
		$this->load->view('view_ventanas', $data);
			
	}
}
?>
